/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  						     standard_campaign_id.cpp

	$Header: /game/standard_campaign_id.cpp $

	$NoKeywords: $

 ************************************************************************/

#include "precompiled.h"
#include "standard_campaign_id.h"

#include <assert.h>

#include "enum_operations.h"

// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
std::string const & get_keyword( t_standard_campaign_id id )
{
	assert( id >= 0 && id < k_standard_campaign_count );

	static std::string const k_keywords[ k_standard_campaign_count ] =
	{
		"tutorial",
		"life",
		"order",
		"death",
		"chaos",
		"nature",
		"might",
	};

	return k_keywords[ id ];
}

// --------------------------------------------------------------------------
// --------------------------------------------------------------------------
t_standard_campaign_id get_standard_campaign_id( std::string const & keyword )
{
	t_standard_campaign_id result;
	for ( result = t_standard_campaign_id( 0 ); true; enum_incr( result ) )
	{
		if ( result >= k_standard_campaign_count )
			return k_standard_campaign_none;

		if ( get_keyword( result ) == keyword )
			break;
	}
	return result;
}
